﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package Display.GridlistUI.model {
    import flash.events.*;
    import org.aswing.*;
    import org.aswing.ext.*;
    import Display.GridlistUI.*;

    public class GenericCellModel extends EventDispatcher implements GridListCell {

        protected var m_gridList:GridList;
        protected var m_selected:Boolean;
        protected var m_index:int;
        protected var m_value:GenericGridListData;

        public function setGridListCellStatus(_arg1:GridList, _arg2:Boolean, _arg3:int):void{
            this.m_gridList = _arg1;
            this.m_selected = _arg2;
            this.m_index = _arg3;
            if (((this.m_gridList) && (this.getCellComponent()))){
                if (this.getCellComponent().getPreferredWidth() > this.m_gridList.getTileWidth()){
                    this.m_gridList.setTileWidth(this.getCellComponent().getPreferredWidth());
                };
                if (this.getCellComponent().getPreferredHeight() > this.m_gridList.getTileHeight()){
                    this.m_gridList.setTileHeight(this.getCellComponent().getPreferredHeight());
                };
            };
        }
        public function setCellValue(_arg1):void{
            this.m_value = (_arg1 as GenericGridListData);
        }
        public function getCellValue(){
            return (this.m_value.data);
        }
        public function getCellComponent():Component{
            return (this.m_value.view);
        }
        public function addListeners():void{
            this.m_value.view.addEventListener(ViewActionEvent.EVENT_TYPE, this.onViewEventTrigger);
        }
        protected function onViewEventTrigger(_arg1:ViewActionEvent):void{
            var _local2:String = _arg1.action;
            if (this[_local2]){
                var _local3 = this;
                _local3[_local2]();
            } else {
                throw (new Error((("Model action " + _local2) + " not supported.")));
            };
        }
        public function removeListeners():void{
        }

    }
}//package Display.GridlistUI.model 
